<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>libcoap: resource.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">libcoap<span id="projectnumber">&#160;4.2.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.8 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('resource_8c.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>

<div class="header">
  <div class="summary">
<a href="#define-members">Macros</a> &#124;
<a href="#func-members">Functions</a> &#124;
<a href="#var-members">Variables</a>  </div>
  <div class="headertitle"><div class="title">resource.c File Reference</div></div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &lt;stdio.h&gt;</code><br />
<code>#include &quot;coap_config.h&quot;</code><br />
<code>#include &quot;<a class="el" href="coap_8h_source.html">coap.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="coap__debug_8h_source.html">coap_debug.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="mem_8h_source.html">mem.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="net_8h_source.html">net.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="resource_8h_source.html">resource.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="subscribe_8h_source.html">subscribe.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="utlist_8h_source.html">utlist.h</a>&quot;</code><br />
</div>
<p><a href="resource_8c_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="define-members" name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:ab6103d900e1505a44a80c24b7a0d5748" id="r_ab6103d900e1505a44a80c24b7a0d5748"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="resource_8c.html#ab6103d900e1505a44a80c24b7a0d5748">COAP_MALLOC_TYPE</a>(Type)&#160;&#160;&#160;  ((coap_##Type##_t *)<a class="el" href="mem_8h.html#a26f40acd710e6c964242c2e0cd789375">coap_malloc</a>(sizeof(coap_##Type##_t)))</td></tr>
<tr class="separator:ab6103d900e1505a44a80c24b7a0d5748"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac04983d170949e7da093b38163fd67ba" id="r_ac04983d170949e7da093b38163fd67ba"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="resource_8c.html#ac04983d170949e7da093b38163fd67ba">COAP_FREE_TYPE</a>(Type,  Object)&#160;&#160;&#160;<a class="el" href="mem_8h.html#a1e46a1505bb13f03fdacd5d1b32502a6">coap_free</a>(Object)</td></tr>
<tr class="separator:ac04983d170949e7da093b38163fd67ba"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a926266b63e0a2e849c28760c5b9de3a1" id="r_a926266b63e0a2e849c28760c5b9de3a1"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="resource_8c.html#a926266b63e0a2e849c28760c5b9de3a1">COAP_PRINT_STATUS_MAX</a>&#160;&#160;&#160;(~<a class="el" href="resource_8h.html#a22f2db8593afab3bb8c153e2346fdf75">COAP_PRINT_STATUS_MASK</a>)</td></tr>
<tr class="separator:a926266b63e0a2e849c28760c5b9de3a1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac6afabdc09a49a433ee19d8a9486056d" id="r_ac6afabdc09a49a433ee19d8a9486056d"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="resource_8c.html#ac6afabdc09a49a433ee19d8a9486056d">min</a>(a,  b)&#160;&#160;&#160;((a) &lt; (b) ? (a) : (b))</td></tr>
<tr class="separator:ac6afabdc09a49a433ee19d8a9486056d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab648602ac2405e4a370ed12191d28b65" id="r_ab648602ac2405e4a370ed12191d28b65"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="resource_8c.html#ab648602ac2405e4a370ed12191d28b65">PRINT_WITH_OFFSET</a>(Buf,  Offset,  Char)</td></tr>
<tr class="memdesc:ab648602ac2405e4a370ed12191d28b65"><td class="mdescLeft">&#160;</td><td class="mdescRight">Adds Char to Buf if Offset is zero.  <br /></td></tr>
<tr class="separator:ab648602ac2405e4a370ed12191d28b65"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a14ba2b84b97974b11e51713b966b6306" id="r_a14ba2b84b97974b11e51713b966b6306"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="resource_8c.html#a14ba2b84b97974b11e51713b966b6306">PRINT_COND_WITH_OFFSET</a>(Buf,  Bufend,  Offset,  Char,  Result)</td></tr>
<tr class="memdesc:a14ba2b84b97974b11e51713b966b6306"><td class="mdescLeft">&#160;</td><td class="mdescRight">Adds Char to Buf if Offset is zero and Buf is less than Bufend.  <br /></td></tr>
<tr class="separator:a14ba2b84b97974b11e51713b966b6306"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae75f2adf0ccfc5294b631608ab35b0f8" id="r_ae75f2adf0ccfc5294b631608ab35b0f8"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="resource_8c.html#ae75f2adf0ccfc5294b631608ab35b0f8">COPY_COND_WITH_OFFSET</a>(Buf,  Bufend,  Offset,  Str,  Length,  Result)</td></tr>
<tr class="memdesc:ae75f2adf0ccfc5294b631608ab35b0f8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Copies at most Length characters of Str to Buf.  <br /></td></tr>
<tr class="separator:ae75f2adf0ccfc5294b631608ab35b0f8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0113eaf27dbb12b09635cfdcdc8cf65f" id="r_a0113eaf27dbb12b09635cfdcdc8cf65f"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="resource_8c.html#a0113eaf27dbb12b09635cfdcdc8cf65f">MATCH_URI</a>&#160;&#160;&#160;0x01</td></tr>
<tr class="separator:a0113eaf27dbb12b09635cfdcdc8cf65f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae2f93c927fa0e3817855347b77803471" id="r_ae2f93c927fa0e3817855347b77803471"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="resource_8c.html#ae2f93c927fa0e3817855347b77803471">MATCH_PREFIX</a>&#160;&#160;&#160;0x02</td></tr>
<tr class="separator:ae2f93c927fa0e3817855347b77803471"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7f8befaaf8f9f8508becb2aca79611d2" id="r_a7f8befaaf8f9f8508becb2aca79611d2"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="resource_8c.html#a7f8befaaf8f9f8508becb2aca79611d2">MATCH_SUBSTRING</a>&#160;&#160;&#160;0x04</td></tr>
<tr class="separator:a7f8befaaf8f9f8508becb2aca79611d2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af776b22a727aae7c9f4d869d50df47e8" id="r_af776b22a727aae7c9f4d869d50df47e8"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="resource_8c.html#af776b22a727aae7c9f4d869d50df47e8">INET6_ADDRSTRLEN</a>&#160;&#160;&#160;40</td></tr>
<tr class="separator:af776b22a727aae7c9f4d869d50df47e8"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a5d3c8be95fcb4b66ba2f399896366a0e" id="r_a5d3c8be95fcb4b66ba2f399896366a0e"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="resource_8c.html#a5d3c8be95fcb4b66ba2f399896366a0e">match</a> (const <a class="el" href="structcoap__str__const__t.html">coap_str_const_t</a> *text, const <a class="el" href="structcoap__str__const__t.html">coap_str_const_t</a> *pattern, int match_prefix, int match_substring)</td></tr>
<tr class="separator:a5d3c8be95fcb4b66ba2f399896366a0e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a82195178fe216a47a0cf8a88aa09c9cd" id="r_a82195178fe216a47a0cf8a88aa09c9cd"><td class="memItemLeft" align="right" valign="top"><a class="el" href="resource_8h.html#a91b02fe05f44f053f50c8d07b03f1f6e">coap_print_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="resource_8c.html#a82195178fe216a47a0cf8a88aa09c9cd">coap_print_wellknown</a> (<a class="el" href="structcoap__context__t.html">coap_context_t</a> *context, unsigned char *buf, size_t *buflen, size_t offset, <a class="el" href="option_8h.html#a963ad4994625360a5ac70d9df2ab5412">coap_opt_t</a> *query_filter)</td></tr>
<tr class="memdesc:a82195178fe216a47a0cf8a88aa09c9cd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Prints the names of all known resources to <code>buf</code>.  <br /></td></tr>
<tr class="separator:a82195178fe216a47a0cf8a88aa09c9cd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9edd43fc111e854367ef646a21bd93b1" id="r_a9edd43fc111e854367ef646a21bd93b1"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structcoap__resource__t.html">coap_resource_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="resource_8c.html#a9edd43fc111e854367ef646a21bd93b1">coap_resource_init</a> (<a class="el" href="structcoap__str__const__t.html">coap_str_const_t</a> *uri_path, int flags)</td></tr>
<tr class="memdesc:a9edd43fc111e854367ef646a21bd93b1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates a new resource object and initializes the link field to the string <code>uri_path</code>.  <br /></td></tr>
<tr class="separator:a9edd43fc111e854367ef646a21bd93b1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af892e2c08f144561327b11b65396d5cc" id="r_af892e2c08f144561327b11b65396d5cc"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structcoap__resource__t.html">coap_resource_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="resource_8c.html#af892e2c08f144561327b11b65396d5cc">coap_resource_unknown_init</a> (<a class="el" href="resource_8h.html#a0e546da5428d06e7bd64308f3e0434af">coap_method_handler_t</a> put_handler)</td></tr>
<tr class="memdesc:af892e2c08f144561327b11b65396d5cc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates a new resource object for the unknown resource handler with support for PUT.  <br /></td></tr>
<tr class="separator:af892e2c08f144561327b11b65396d5cc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a54aa07af07426669c88abfa83f13261d" id="r_a54aa07af07426669c88abfa83f13261d"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structcoap__attr__t.html">coap_attr_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="resource_8c.html#a54aa07af07426669c88abfa83f13261d">coap_add_attr</a> (<a class="el" href="structcoap__resource__t.html">coap_resource_t</a> *resource, <a class="el" href="structcoap__str__const__t.html">coap_str_const_t</a> *name, <a class="el" href="structcoap__str__const__t.html">coap_str_const_t</a> *val, int flags)</td></tr>
<tr class="memdesc:a54aa07af07426669c88abfa83f13261d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Registers a new attribute with the given <code>resource</code>.  <br /></td></tr>
<tr class="separator:a54aa07af07426669c88abfa83f13261d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adda0a00000cfd2cd898f1d5d074c921f" id="r_adda0a00000cfd2cd898f1d5d074c921f"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structcoap__attr__t.html">coap_attr_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="resource_8c.html#adda0a00000cfd2cd898f1d5d074c921f">coap_find_attr</a> (<a class="el" href="structcoap__resource__t.html">coap_resource_t</a> *resource, <a class="el" href="structcoap__str__const__t.html">coap_str_const_t</a> *name)</td></tr>
<tr class="memdesc:adda0a00000cfd2cd898f1d5d074c921f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns <code>resource's</code> <a class="el" href="structcoap__attr__t.html">coap_attr_t</a> object with given <code>name</code> if found, <code>NULL</code> otherwise.  <br /></td></tr>
<tr class="separator:adda0a00000cfd2cd898f1d5d074c921f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a37883d9c8bafdd59fd1bd57dcb82e908" id="r_a37883d9c8bafdd59fd1bd57dcb82e908"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="resource_8c.html#a37883d9c8bafdd59fd1bd57dcb82e908">coap_delete_attr</a> (<a class="el" href="structcoap__attr__t.html">coap_attr_t</a> *attr)</td></tr>
<tr class="memdesc:a37883d9c8bafdd59fd1bd57dcb82e908"><td class="mdescLeft">&#160;</td><td class="mdescRight">Deletes an attribute.  <br /></td></tr>
<tr class="separator:a37883d9c8bafdd59fd1bd57dcb82e908"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1307a6b8dadd6d005352ce02f6cf392f" id="r_a1307a6b8dadd6d005352ce02f6cf392f"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="resource_8c.html#a1307a6b8dadd6d005352ce02f6cf392f">coap_free_resource</a> (<a class="el" href="structcoap__resource__t.html">coap_resource_t</a> *resource)</td></tr>
<tr class="separator:a1307a6b8dadd6d005352ce02f6cf392f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9a5f0705912b0a35a3d5764e86b94004" id="r_a9a5f0705912b0a35a3d5764e86b94004"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="resource_8c.html#a9a5f0705912b0a35a3d5764e86b94004">coap_add_resource</a> (<a class="el" href="structcoap__context__t.html">coap_context_t</a> *context, <a class="el" href="structcoap__resource__t.html">coap_resource_t</a> *resource)</td></tr>
<tr class="memdesc:a9a5f0705912b0a35a3d5764e86b94004"><td class="mdescLeft">&#160;</td><td class="mdescRight">Registers the given <code>resource</code> for <code>context</code>.  <br /></td></tr>
<tr class="separator:a9a5f0705912b0a35a3d5764e86b94004"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad3521b724ad4961e6bb11801fd82a3e3" id="r_ad3521b724ad4961e6bb11801fd82a3e3"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="resource_8c.html#ad3521b724ad4961e6bb11801fd82a3e3">coap_delete_resource</a> (<a class="el" href="structcoap__context__t.html">coap_context_t</a> *context, <a class="el" href="structcoap__resource__t.html">coap_resource_t</a> *resource)</td></tr>
<tr class="memdesc:ad3521b724ad4961e6bb11801fd82a3e3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Deletes a resource identified by <code>resource</code>.  <br /></td></tr>
<tr class="separator:ad3521b724ad4961e6bb11801fd82a3e3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1fae3046ad94fce85a7ea23455328958" id="r_a1fae3046ad94fce85a7ea23455328958"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="resource_8c.html#a1fae3046ad94fce85a7ea23455328958">coap_delete_all_resources</a> (<a class="el" href="structcoap__context__t.html">coap_context_t</a> *context)</td></tr>
<tr class="memdesc:a1fae3046ad94fce85a7ea23455328958"><td class="mdescLeft">&#160;</td><td class="mdescRight">Deletes all resources from given <code>context</code> and frees their storage.  <br /></td></tr>
<tr class="separator:a1fae3046ad94fce85a7ea23455328958"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3247f7d06524ccbad44273ae9cdfecad" id="r_a3247f7d06524ccbad44273ae9cdfecad"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structcoap__resource__t.html">coap_resource_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="resource_8c.html#a3247f7d06524ccbad44273ae9cdfecad">coap_get_resource_from_uri_path</a> (<a class="el" href="structcoap__context__t.html">coap_context_t</a> *context, <a class="el" href="structcoap__str__const__t.html">coap_str_const_t</a> *uri_path)</td></tr>
<tr class="memdesc:a3247f7d06524ccbad44273ae9cdfecad"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the resource identified by the unique string <code>uri_path</code>.  <br /></td></tr>
<tr class="separator:a3247f7d06524ccbad44273ae9cdfecad"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1ee72943df541ed5d4294c13e967ef09" id="r_a1ee72943df541ed5d4294c13e967ef09"><td class="memItemLeft" align="right" valign="top"><a class="el" href="resource_8h.html#a91b02fe05f44f053f50c8d07b03f1f6e">coap_print_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="resource_8c.html#a1ee72943df541ed5d4294c13e967ef09">coap_print_link</a> (const <a class="el" href="structcoap__resource__t.html">coap_resource_t</a> *resource, unsigned char *buf, size_t *len, size_t *offset)</td></tr>
<tr class="memdesc:a1ee72943df541ed5d4294c13e967ef09"><td class="mdescLeft">&#160;</td><td class="mdescRight">Writes a description of this resource in link-format to given text buffer.  <br /></td></tr>
<tr class="separator:a1ee72943df541ed5d4294c13e967ef09"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af3e125d7975a649b6ac818c8bfb87baa" id="r_af3e125d7975a649b6ac818c8bfb87baa"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="resource_8c.html#af3e125d7975a649b6ac818c8bfb87baa">coap_register_handler</a> (<a class="el" href="structcoap__resource__t.html">coap_resource_t</a> *resource, unsigned char method, <a class="el" href="resource_8h.html#a0e546da5428d06e7bd64308f3e0434af">coap_method_handler_t</a> handler)</td></tr>
<tr class="memdesc:af3e125d7975a649b6ac818c8bfb87baa"><td class="mdescLeft">&#160;</td><td class="mdescRight">Registers the specified <code>handler</code> as message handler for the request type <code>method</code>.  <br /></td></tr>
<tr class="separator:af3e125d7975a649b6ac818c8bfb87baa"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad6d585115f3bfa62c5e9d6129009c6c7" id="r_ad6d585115f3bfa62c5e9d6129009c6c7"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structcoap__subscription__t.html">coap_subscription_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="resource_8c.html#ad6d585115f3bfa62c5e9d6129009c6c7">coap_find_observer</a> (<a class="el" href="structcoap__resource__t.html">coap_resource_t</a> *resource, <a class="el" href="structcoap__session__t.html">coap_session_t</a> *session, const <a class="el" href="structcoap__binary__t.html">coap_binary_t</a> *token)</td></tr>
<tr class="memdesc:ad6d585115f3bfa62c5e9d6129009c6c7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns a subscription object for given <code>peer</code>.  <br /></td></tr>
<tr class="separator:ad6d585115f3bfa62c5e9d6129009c6c7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3c9f5916b88cf48196fd51516f7a55dd" id="r_a3c9f5916b88cf48196fd51516f7a55dd"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="structcoap__subscription__t.html">coap_subscription_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="resource_8c.html#a3c9f5916b88cf48196fd51516f7a55dd">coap_find_observer_query</a> (<a class="el" href="structcoap__resource__t.html">coap_resource_t</a> *resource, <a class="el" href="structcoap__session__t.html">coap_session_t</a> *session, const <a class="el" href="structcoap__string__t.html">coap_string_t</a> *query)</td></tr>
<tr class="separator:a3c9f5916b88cf48196fd51516f7a55dd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa04a51c7660283d48f60bf899fe5c45b" id="r_aa04a51c7660283d48f60bf899fe5c45b"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structcoap__subscription__t.html">coap_subscription_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="resource_8c.html#aa04a51c7660283d48f60bf899fe5c45b">coap_add_observer</a> (<a class="el" href="structcoap__resource__t.html">coap_resource_t</a> *resource, <a class="el" href="structcoap__session__t.html">coap_session_t</a> *session, const <a class="el" href="structcoap__binary__t.html">coap_binary_t</a> *token, <a class="el" href="structcoap__string__t.html">coap_string_t</a> *query, int has_block2, <a class="el" href="structcoap__block__t.html">coap_block_t</a> block2)</td></tr>
<tr class="memdesc:aa04a51c7660283d48f60bf899fe5c45b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Adds the specified peer as observer for <code>resource</code>.  <br /></td></tr>
<tr class="separator:aa04a51c7660283d48f60bf899fe5c45b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad5bbd78aad763b34f4c0905fcd7b7454" id="r_ad5bbd78aad763b34f4c0905fcd7b7454"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="resource_8c.html#ad5bbd78aad763b34f4c0905fcd7b7454">coap_touch_observer</a> (<a class="el" href="structcoap__context__t.html">coap_context_t</a> *context, <a class="el" href="structcoap__session__t.html">coap_session_t</a> *session, const <a class="el" href="structcoap__binary__t.html">coap_binary_t</a> *token)</td></tr>
<tr class="memdesc:ad5bbd78aad763b34f4c0905fcd7b7454"><td class="mdescLeft">&#160;</td><td class="mdescRight">Marks an observer as alive.  <br /></td></tr>
<tr class="separator:ad5bbd78aad763b34f4c0905fcd7b7454"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0ea23a6e5f19c9081f282e0a7cc4452d" id="r_a0ea23a6e5f19c9081f282e0a7cc4452d"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="resource_8c.html#a0ea23a6e5f19c9081f282e0a7cc4452d">coap_delete_observer</a> (<a class="el" href="structcoap__resource__t.html">coap_resource_t</a> *resource, <a class="el" href="structcoap__session__t.html">coap_session_t</a> *session, const <a class="el" href="structcoap__binary__t.html">coap_binary_t</a> *token)</td></tr>
<tr class="memdesc:a0ea23a6e5f19c9081f282e0a7cc4452d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Removes any subscription for <code>observer</code> from <code>resource</code> and releases the allocated storage.  <br /></td></tr>
<tr class="separator:a0ea23a6e5f19c9081f282e0a7cc4452d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5456a0b3cbb6c2191420632da0c54bbf" id="r_a5456a0b3cbb6c2191420632da0c54bbf"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="resource_8c.html#a5456a0b3cbb6c2191420632da0c54bbf">coap_delete_observers</a> (<a class="el" href="structcoap__context__t.html">coap_context_t</a> *context, <a class="el" href="structcoap__session__t.html">coap_session_t</a> *session)</td></tr>
<tr class="memdesc:a5456a0b3cbb6c2191420632da0c54bbf"><td class="mdescLeft">&#160;</td><td class="mdescRight">Removes any subscription for <code>session</code> and releases the allocated storage.  <br /></td></tr>
<tr class="separator:a5456a0b3cbb6c2191420632da0c54bbf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae1a91e254baca4f43b7896f54a8d9944" id="r_ae1a91e254baca4f43b7896f54a8d9944"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="resource_8c.html#ae1a91e254baca4f43b7896f54a8d9944">coap_notify_observers</a> (<a class="el" href="structcoap__context__t.html">coap_context_t</a> *context, <a class="el" href="structcoap__resource__t.html">coap_resource_t</a> *r)</td></tr>
<tr class="separator:ae1a91e254baca4f43b7896f54a8d9944"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a498adb2e66123e55cf6b0bb0ee061760" id="r_a498adb2e66123e55cf6b0bb0ee061760"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="resource_8c.html#a498adb2e66123e55cf6b0bb0ee061760">coap_resource_set_dirty</a> (<a class="el" href="structcoap__resource__t.html">coap_resource_t</a> *r, const <a class="el" href="structcoap__string__t.html">coap_string_t</a> *query)</td></tr>
<tr class="separator:a498adb2e66123e55cf6b0bb0ee061760"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a44d6a5ed6425069699a01f7e8ed72579" id="r_a44d6a5ed6425069699a01f7e8ed72579"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="resource_8c.html#a44d6a5ed6425069699a01f7e8ed72579">coap_resource_notify_observers</a> (<a class="el" href="structcoap__resource__t.html">coap_resource_t</a> *r, const <a class="el" href="structcoap__string__t.html">coap_string_t</a> *query)</td></tr>
<tr class="memdesc:a44d6a5ed6425069699a01f7e8ed72579"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initiate the sending of an Observe packet for all observers of <code>resource</code>, optionally matching <code>query</code> if not NULL.  <br /></td></tr>
<tr class="separator:a44d6a5ed6425069699a01f7e8ed72579"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a579bcb559463d3a872831c18d8d9a1c1" id="r_a579bcb559463d3a872831c18d8d9a1c1"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="resource_8c.html#a579bcb559463d3a872831c18d8d9a1c1">coap_check_notify</a> (<a class="el" href="structcoap__context__t.html">coap_context_t</a> *context)</td></tr>
<tr class="memdesc:a579bcb559463d3a872831c18d8d9a1c1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Checks for all known resources, if they are dirty and notifies subscribed observers.  <br /></td></tr>
<tr class="separator:a579bcb559463d3a872831c18d8d9a1c1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a912a935612cb6910a4c466c49d58ee98" id="r_a912a935612cb6910a4c466c49d58ee98"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="resource_8c.html#a912a935612cb6910a4c466c49d58ee98">coap_remove_failed_observers</a> (<a class="el" href="structcoap__context__t.html">coap_context_t</a> *context, <a class="el" href="structcoap__resource__t.html">coap_resource_t</a> *resource, <a class="el" href="structcoap__session__t.html">coap_session_t</a> *session, const <a class="el" href="structcoap__binary__t.html">coap_binary_t</a> *token)</td></tr>
<tr class="memdesc:a912a935612cb6910a4c466c49d58ee98"><td class="mdescLeft">&#160;</td><td class="mdescRight">Checks the failure counter for (peer, token) and removes peer from the list of observers for the given resource when COAP_OBS_MAX_FAIL is reached.  <br /></td></tr>
<tr class="separator:a912a935612cb6910a4c466c49d58ee98"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6fe7101754779c34807bf00b87ee5f0b" id="r_a6fe7101754779c34807bf00b87ee5f0b"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="resource_8c.html#a6fe7101754779c34807bf00b87ee5f0b">coap_handle_failed_notify</a> (<a class="el" href="structcoap__context__t.html">coap_context_t</a> *context, <a class="el" href="structcoap__session__t.html">coap_session_t</a> *session, const <a class="el" href="structcoap__binary__t.html">coap_binary_t</a> *token)</td></tr>
<tr class="separator:a6fe7101754779c34807bf00b87ee5f0b"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="var-members" name="var-members"></a>
Variables</h2></td></tr>
<tr class="memitem:abbe07ff1da181a7b0429384afaf0c381" id="r_abbe07ff1da181a7b0429384afaf0c381"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="structcoap__str__const__t.html">coap_str_const_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="resource_8c.html#abbe07ff1da181a7b0429384afaf0c381">null_path</a> = <a class="el" href="group__string.html#ga3a9d1f377dc7a25aa8b6136a169f76c1">coap_make_str_const</a>(&quot;&quot;)</td></tr>
<tr class="separator:abbe07ff1da181a7b0429384afaf0c381"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0ace1279431c2224cf7c4a95fed6d0e0" id="r_a0ace1279431c2224cf7c4a95fed6d0e0"><td class="memItemLeft" align="right" valign="top">static const <a class="el" href="uthash_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="resource_8c.html#a0ace1279431c2224cf7c4a95fed6d0e0">coap_unknown_resource_uri</a> []</td></tr>
<tr class="separator:a0ace1279431c2224cf7c4a95fed6d0e0"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Macro Definition Documentation</h2>
<a id="ac04983d170949e7da093b38163fd67ba" name="ac04983d170949e7da093b38163fd67ba"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac04983d170949e7da093b38163fd67ba">&#9670;&#160;</a></span>COAP_FREE_TYPE</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define COAP_FREE_TYPE</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">Type, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">Object&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td>&#160;&#160;&#160;<a class="el" href="mem_8h.html#a1e46a1505bb13f03fdacd5d1b32502a6">coap_free</a>(Object)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="resource_8c_source.html#l00058">58</a> of file <a class="el" href="resource_8c_source.html">resource.c</a>.</p>

</div>
</div>
<a id="ab6103d900e1505a44a80c24b7a0d5748" name="ab6103d900e1505a44a80c24b7a0d5748"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab6103d900e1505a44a80c24b7a0d5748">&#9670;&#160;</a></span>COAP_MALLOC_TYPE</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define COAP_MALLOC_TYPE</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">Type</td><td>)</td>
          <td>&#160;&#160;&#160;  ((coap_##Type##_t *)<a class="el" href="mem_8h.html#a26f40acd710e6c964242c2e0cd789375">coap_malloc</a>(sizeof(coap_##Type##_t)))</td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="resource_8c_source.html#l00056">56</a> of file <a class="el" href="resource_8c_source.html">resource.c</a>.</p>

</div>
</div>
<a id="a926266b63e0a2e849c28760c5b9de3a1" name="a926266b63e0a2e849c28760c5b9de3a1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a926266b63e0a2e849c28760c5b9de3a1">&#9670;&#160;</a></span>COAP_PRINT_STATUS_MAX</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define COAP_PRINT_STATUS_MAX&#160;&#160;&#160;(~<a class="el" href="resource_8h.html#a22f2db8593afab3bb8c153e2346fdf75">COAP_PRINT_STATUS_MASK</a>)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="resource_8c_source.html#l00061">61</a> of file <a class="el" href="resource_8c_source.html">resource.c</a>.</p>

</div>
</div>
<a id="ae75f2adf0ccfc5294b631608ab35b0f8" name="ae75f2adf0ccfc5294b631608ab35b0f8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae75f2adf0ccfc5294b631608ab35b0f8">&#9670;&#160;</a></span>COPY_COND_WITH_OFFSET</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define COPY_COND_WITH_OFFSET</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">Buf, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">Bufend, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">Offset, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">Str, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">Length, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">Result&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">    {        \</div>
<div class="line">    <span class="keywordtype">size_t</span> i;                                                                \</div>
<div class="line">    for (i = 0; i &lt; (Length); i++) {                                        \</div>
<div class="line">      PRINT_COND_WITH_OFFSET((Buf), (Bufend), (Offset), (Str)[i], (Result)); \</div>
<div class="line">    }                                                                        \</div>
<div class="line">  }</div>
</div><!-- fragment -->
<p>Copies at most Length characters of Str to Buf. </p>
<p>The first Offset characters are skipped. Output may be truncated to Bufend - Buf characters. </p>

<p class="definition">Definition at line <a class="el" href="resource_8c_source.html#l00097">97</a> of file <a class="el" href="resource_8c_source.html">resource.c</a>.</p>

</div>
</div>
<a id="af776b22a727aae7c9f4d869d50df47e8" name="af776b22a727aae7c9f4d869d50df47e8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af776b22a727aae7c9f4d869d50df47e8">&#9670;&#160;</a></span>INET6_ADDRSTRLEN</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define INET6_ADDRSTRLEN&#160;&#160;&#160;40</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="ae2f93c927fa0e3817855347b77803471" name="ae2f93c927fa0e3817855347b77803471"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae2f93c927fa0e3817855347b77803471">&#9670;&#160;</a></span>MATCH_PREFIX</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define MATCH_PREFIX&#160;&#160;&#160;0x02</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="a7f8befaaf8f9f8508becb2aca79611d2" name="a7f8befaaf8f9f8508becb2aca79611d2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7f8befaaf8f9f8508becb2aca79611d2">&#9670;&#160;</a></span>MATCH_SUBSTRING</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define MATCH_SUBSTRING&#160;&#160;&#160;0x04</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="a0113eaf27dbb12b09635cfdcdc8cf65f" name="a0113eaf27dbb12b09635cfdcdc8cf65f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0113eaf27dbb12b09635cfdcdc8cf65f">&#9670;&#160;</a></span>MATCH_URI</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define MATCH_URI&#160;&#160;&#160;0x01</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="ac6afabdc09a49a433ee19d8a9486056d" name="ac6afabdc09a49a433ee19d8a9486056d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac6afabdc09a49a433ee19d8a9486056d">&#9670;&#160;</a></span>min</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define min</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">a, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">b&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td>&#160;&#160;&#160;((a) &lt; (b) ? (a) : (b))</td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="resource_8c_source.html#l00064">64</a> of file <a class="el" href="resource_8c_source.html">resource.c</a>.</p>

</div>
</div>
<a id="a14ba2b84b97974b11e51713b966b6306" name="a14ba2b84b97974b11e51713b966b6306"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a14ba2b84b97974b11e51713b966b6306">&#9670;&#160;</a></span>PRINT_COND_WITH_OFFSET</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define PRINT_COND_WITH_OFFSET</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">Buf, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">Bufend, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">Offset, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">Char, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">Result&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">    {                \</div>
<div class="line">    if ((Buf) &lt; (Bufend)) {                                                \</div>
<div class="line">      PRINT_WITH_OFFSET(Buf,Offset,Char);                                \</div>
<div class="line">    }                                                                        \</div>
<div class="line">    (Result)++;                                                                \</div>
<div class="line">  }</div>
</div><!-- fragment -->
<p>Adds Char to Buf if Offset is zero and Buf is less than Bufend. </p>

<p class="definition">Definition at line <a class="el" href="resource_8c_source.html#l00085">85</a> of file <a class="el" href="resource_8c_source.html">resource.c</a>.</p>

</div>
</div>
<a id="ab648602ac2405e4a370ed12191d28b65" name="ab648602ac2405e4a370ed12191d28b65"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab648602ac2405e4a370ed12191d28b65">&#9670;&#160;</a></span>PRINT_WITH_OFFSET</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define PRINT_WITH_OFFSET</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">Buf, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">Offset, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">Char&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">  <span class="keywordflow">if</span> ((Offset) == 0) {                                        \</div>
<div class="line">    (*(Buf)++) = (Char);                                \</div>
<div class="line">  } <span class="keywordflow">else</span> {                                                \</div>
<div class="line">    (Offset)--;                                                \</div>
<div class="line">  }                                                        \</div>
</div><!-- fragment -->
<p>Adds Char to Buf if Offset is zero. </p>
<p>Otherwise, Char is not written and Offset is decremented. </p>

<p class="definition">Definition at line <a class="el" href="resource_8c_source.html#l00075">75</a> of file <a class="el" href="resource_8c_source.html">resource.c</a>.</p>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="a54aa07af07426669c88abfa83f13261d" name="a54aa07af07426669c88abfa83f13261d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a54aa07af07426669c88abfa83f13261d">&#9670;&#160;</a></span>coap_add_attr()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structcoap__attr__t.html">coap_attr_t</a> * coap_add_attr </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__resource__t.html">coap_resource_t</a> *&#160;</td>
          <td class="paramname"><em>resource</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcoap__str__const__t.html">coap_str_const_t</a> *&#160;</td>
          <td class="paramname"><em>name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcoap__str__const__t.html">coap_str_const_t</a> *&#160;</td>
          <td class="paramname"><em>value</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>flags</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Registers a new attribute with the given <code>resource</code>. </p>
<p>As the attribute's coap_str_const_ fields will point to <code>name</code> and <code>value</code> the caller must ensure that these pointers are valid during the attribute's lifetime.</p>
<p>If the <code>name</code> and/or <code>value</code> string is going to be freed off at attribute removal time by the setting of COAP_ATTR_FLAGS_RELEASE_NAME or COAP_ATTR_FLAGS_RELEASE_VALUE in <code>flags</code>, then either the 's' variable of <a class="el" href="structcoap__str__const__t.html" title="Coap string data definition with const data.">coap_str_const_t</a> has to point to constant text, or point to data within the allocated <a class="el" href="structcoap__str__const__t.html" title="Coap string data definition with const data.">coap_str_const_t</a> parameter.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">resource</td><td>The resource to register the attribute with. </td></tr>
    <tr><td class="paramname">name</td><td>The attribute's name as a string. </td></tr>
    <tr><td class="paramname">value</td><td>The attribute's value as a string or <code>NULL</code> if none. </td></tr>
    <tr><td class="paramname">flags</td><td>Flags for memory management (in particular release of memory). Possible values:<br  />
 COAP_ATTR_FLAGS_RELEASE_NAME If this flag is set, the name passed to coap_add_attr_release() is free'd when the attribute is deleted<br  />
 COAP_ATTR_FLAGS_RELEASE_VALUE If this flag is set, the value passed to coap_add_attr_release() is free'd when the attribute is deleted<br  />
 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A pointer to the new attribute or <code>NULL</code> on error. </dd></dl>

<p class="definition">Definition at line <a class="el" href="resource_8c_source.html#l00352">352</a> of file <a class="el" href="resource_8c_source.html">resource.c</a>.</p>

</div>
</div>
<a id="aa04a51c7660283d48f60bf899fe5c45b" name="aa04a51c7660283d48f60bf899fe5c45b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa04a51c7660283d48f60bf899fe5c45b">&#9670;&#160;</a></span>coap_add_observer()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structcoap__subscription__t.html">coap_subscription_t</a> * coap_add_observer </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__resource__t.html">coap_resource_t</a> *&#160;</td>
          <td class="paramname"><em>resource</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcoap__session__t.html">coap_session_t</a> *&#160;</td>
          <td class="paramname"><em>session</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structcoap__binary__t.html">coap_binary_t</a> *&#160;</td>
          <td class="paramname"><em>token</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcoap__string__t.html">coap_string_t</a> *&#160;</td>
          <td class="paramname"><em>query</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>has_block2</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcoap__block__t.html">coap_block_t</a>&#160;</td>
          <td class="paramname"><em>block2</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Adds the specified peer as observer for <code>resource</code>. </p>
<p>The subscription is identified by the given <code>token</code>. This function returns the registered subscription information if the <code>observer</code> has been added, or <code>NULL</code> on error.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">resource</td><td>The observed resource. </td></tr>
    <tr><td class="paramname">session</td><td>The observer's session </td></tr>
    <tr><td class="paramname">token</td><td>The token that identifies this subscription. </td></tr>
    <tr><td class="paramname">query</td><td>The query string, if any. subscription will take ownership of the string. </td></tr>
    <tr><td class="paramname">has_block2</td><td>If Option Block2 defined. </td></tr>
    <tr><td class="paramname">block2</td><td>Contents of Block2 if Block 2 defined. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A pointer to the added/updated subscription information or <code>NULL</code> on error. </dd></dl>

<p class="definition">Definition at line <a class="el" href="resource_8c_source.html#l00623">623</a> of file <a class="el" href="resource_8c_source.html">resource.c</a>.</p>

</div>
</div>
<a id="a9a5f0705912b0a35a3d5764e86b94004" name="a9a5f0705912b0a35a3d5764e86b94004"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9a5f0705912b0a35a3d5764e86b94004">&#9670;&#160;</a></span>coap_add_resource()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void coap_add_resource </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__context__t.html">coap_context_t</a> *&#160;</td>
          <td class="paramname"><em>context</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcoap__resource__t.html">coap_resource_t</a> *&#160;</td>
          <td class="paramname"><em>resource</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Registers the given <code>resource</code> for <code>context</code>. </p>
<p>The resource must have been created by <a class="el" href="resource_8h.html#a9edd43fc111e854367ef646a21bd93b1" title="Creates a new resource object and initializes the link field to the string uri_path.">coap_resource_init()</a> or <a class="el" href="resource_8h.html#af892e2c08f144561327b11b65396d5cc" title="Creates a new resource object for the unknown resource handler with support for PUT.">coap_resource_unknown_init()</a>, the storage allocated for the resource will be released by <a class="el" href="resource_8h.html#ad3521b724ad4961e6bb11801fd82a3e3" title="Deletes a resource identified by resource.">coap_delete_resource()</a>.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">context</td><td>The context to use. </td></tr>
    <tr><td class="paramname">resource</td><td>The resource to store. </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="resource_8c_source.html#l00452">452</a> of file <a class="el" href="resource_8c_source.html">resource.c</a>.</p>

</div>
</div>
<a id="a579bcb559463d3a872831c18d8d9a1c1" name="a579bcb559463d3a872831c18d8d9a1c1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a579bcb559463d3a872831c18d8d9a1c1">&#9670;&#160;</a></span>coap_check_notify()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void coap_check_notify </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__context__t.html">coap_context_t</a> *&#160;</td>
          <td class="paramname"><em>context</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Checks for all known resources, if they are dirty and notifies subscribed observers. </p>

<p class="definition">Definition at line <a class="el" href="resource_8c_source.html#l00869">869</a> of file <a class="el" href="resource_8c_source.html">resource.c</a>.</p>

</div>
</div>
<a id="a1fae3046ad94fce85a7ea23455328958" name="a1fae3046ad94fce85a7ea23455328958"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1fae3046ad94fce85a7ea23455328958">&#9670;&#160;</a></span>coap_delete_all_resources()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void coap_delete_all_resources </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__context__t.html">coap_context_t</a> *&#160;</td>
          <td class="paramname"><em>context</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Deletes all resources from given <code>context</code> and frees their storage. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">context</td><td>The CoAP context with the resources to be deleted. </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="resource_8c_source.html#l00494">494</a> of file <a class="el" href="resource_8c_source.html">resource.c</a>.</p>

</div>
</div>
<a id="a37883d9c8bafdd59fd1bd57dcb82e908" name="a37883d9c8bafdd59fd1bd57dcb82e908"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a37883d9c8bafdd59fd1bd57dcb82e908">&#9670;&#160;</a></span>coap_delete_attr()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void coap_delete_attr </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__attr__t.html">coap_attr_t</a> *&#160;</td>
          <td class="paramname"><em>attr</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Deletes an attribute. </p>
<p>Note: This is for internal use only, as it is not deleted from its chain.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">attr</td><td>Pointer to a previously created attribute. </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="resource_8c_source.html#l00406">406</a> of file <a class="el" href="resource_8c_source.html">resource.c</a>.</p>

</div>
</div>
<a id="a0ea23a6e5f19c9081f282e0a7cc4452d" name="a0ea23a6e5f19c9081f282e0a7cc4452d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0ea23a6e5f19c9081f282e0a7cc4452d">&#9670;&#160;</a></span>coap_delete_observer()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int coap_delete_observer </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__resource__t.html">coap_resource_t</a> *&#160;</td>
          <td class="paramname"><em>resource</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcoap__session__t.html">coap_session_t</a> *&#160;</td>
          <td class="paramname"><em>session</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structcoap__binary__t.html">coap_binary_t</a> *&#160;</td>
          <td class="paramname"><em>token</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Removes any subscription for <code>observer</code> from <code>resource</code> and releases the allocated storage. </p>
<p>The result is <code>1</code> if an observation relationship with <code>observer</code> and <code>token</code> existed, <code>0</code> otherwise.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">resource</td><td>The observed resource. </td></tr>
    <tr><td class="paramname">session</td><td>The observer's session. </td></tr>
    <tr><td class="paramname">token</td><td>The token that identifies this subscription or <code>NULL</code> for any token. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><code>1</code> if the observer has been deleted, <code>0</code> otherwise. </dd></dl>

<p class="definition">Definition at line <a class="el" href="resource_8c_source.html#l00703">703</a> of file <a class="el" href="resource_8c_source.html">resource.c</a>.</p>

</div>
</div>
<a id="a5456a0b3cbb6c2191420632da0c54bbf" name="a5456a0b3cbb6c2191420632da0c54bbf"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5456a0b3cbb6c2191420632da0c54bbf">&#9670;&#160;</a></span>coap_delete_observers()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void coap_delete_observers </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__context__t.html">coap_context_t</a> *&#160;</td>
          <td class="paramname"><em>context</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcoap__session__t.html">coap_session_t</a> *&#160;</td>
          <td class="paramname"><em>session</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Removes any subscription for <code>session</code> and releases the allocated storage. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">context</td><td>The CoAP context to use. </td></tr>
    <tr><td class="paramname">session</td><td>The observer's session. </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="resource_8c_source.html#l00729">729</a> of file <a class="el" href="resource_8c_source.html">resource.c</a>.</p>

</div>
</div>
<a id="ad3521b724ad4961e6bb11801fd82a3e3" name="ad3521b724ad4961e6bb11801fd82a3e3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad3521b724ad4961e6bb11801fd82a3e3">&#9670;&#160;</a></span>coap_delete_resource()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int coap_delete_resource </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__context__t.html">coap_context_t</a> *&#160;</td>
          <td class="paramname"><em>context</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcoap__resource__t.html">coap_resource_t</a> *&#160;</td>
          <td class="paramname"><em>resource</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Deletes a resource identified by <code>resource</code>. </p>
<p>The storage allocated for that resource is freed, and removed from the context.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">context</td><td>The context where the resources are stored. </td></tr>
    <tr><td class="paramname">resource</td><td>The resource to delete.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><code>1</code> if the resource was found (and destroyed), <code>0</code> otherwise. </dd></dl>

<p class="definition">Definition at line <a class="el" href="resource_8c_source.html#l00474">474</a> of file <a class="el" href="resource_8c_source.html">resource.c</a>.</p>

</div>
</div>
<a id="adda0a00000cfd2cd898f1d5d074c921f" name="adda0a00000cfd2cd898f1d5d074c921f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#adda0a00000cfd2cd898f1d5d074c921f">&#9670;&#160;</a></span>coap_find_attr()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structcoap__attr__t.html">coap_attr_t</a> * coap_find_attr </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__resource__t.html">coap_resource_t</a> *&#160;</td>
          <td class="paramname"><em>resource</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcoap__str__const__t.html">coap_str_const_t</a> *&#160;</td>
          <td class="paramname"><em>name</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns <code>resource's</code> <a class="el" href="structcoap__attr__t.html">coap_attr_t</a> object with given <code>name</code> if found, <code>NULL</code> otherwise. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">resource</td><td>The resource to search for attribute <code>name</code>. </td></tr>
    <tr><td class="paramname">name</td><td>Name of the requested attribute as a string. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The first attribute with specified <code>name</code> or <code>NULL</code> if none was found. </dd></dl>

<p class="definition">Definition at line <a class="el" href="resource_8c_source.html#l00389">389</a> of file <a class="el" href="resource_8c_source.html">resource.c</a>.</p>

</div>
</div>
<a id="ad6d585115f3bfa62c5e9d6129009c6c7" name="ad6d585115f3bfa62c5e9d6129009c6c7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad6d585115f3bfa62c5e9d6129009c6c7">&#9670;&#160;</a></span>coap_find_observer()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structcoap__subscription__t.html">coap_subscription_t</a> * coap_find_observer </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__resource__t.html">coap_resource_t</a> *&#160;</td>
          <td class="paramname"><em>resource</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcoap__session__t.html">coap_session_t</a> *&#160;</td>
          <td class="paramname"><em>session</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structcoap__binary__t.html">coap_binary_t</a> *&#160;</td>
          <td class="paramname"><em>token</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns a subscription object for given <code>peer</code>. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">resource</td><td>The observed resource. </td></tr>
    <tr><td class="paramname">session</td><td>The observer's session </td></tr>
    <tr><td class="paramname">token</td><td>The token that identifies this subscription or <code>NULL</code> for any token. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A valid subscription if exists or <code>NULL</code> otherwise. </dd></dl>

<p class="definition">Definition at line <a class="el" href="resource_8c_source.html#l00587">587</a> of file <a class="el" href="resource_8c_source.html">resource.c</a>.</p>

</div>
</div>
<a id="a3c9f5916b88cf48196fd51516f7a55dd" name="a3c9f5916b88cf48196fd51516f7a55dd"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3c9f5916b88cf48196fd51516f7a55dd">&#9670;&#160;</a></span>coap_find_observer_query()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="structcoap__subscription__t.html">coap_subscription_t</a> * coap_find_observer_query </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__resource__t.html">coap_resource_t</a> *&#160;</td>
          <td class="paramname"><em>resource</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcoap__session__t.html">coap_session_t</a> *&#160;</td>
          <td class="paramname"><em>session</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structcoap__string__t.html">coap_string_t</a> *&#160;</td>
          <td class="paramname"><em>query</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="resource_8c_source.html#l00605">605</a> of file <a class="el" href="resource_8c_source.html">resource.c</a>.</p>

</div>
</div>
<a id="a1307a6b8dadd6d005352ce02f6cf392f" name="a1307a6b8dadd6d005352ce02f6cf392f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1307a6b8dadd6d005352ce02f6cf392f">&#9670;&#160;</a></span>coap_free_resource()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void coap_free_resource </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__resource__t.html">coap_resource_t</a> *&#160;</td>
          <td class="paramname"><em>resource</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="resource_8c_source.html#l00423">423</a> of file <a class="el" href="resource_8c_source.html">resource.c</a>.</p>

</div>
</div>
<a id="a3247f7d06524ccbad44273ae9cdfecad" name="a3247f7d06524ccbad44273ae9cdfecad"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3247f7d06524ccbad44273ae9cdfecad">&#9670;&#160;</a></span>coap_get_resource_from_uri_path()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structcoap__resource__t.html">coap_resource_t</a> * coap_get_resource_from_uri_path </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__context__t.html">coap_context_t</a> *&#160;</td>
          <td class="paramname"><em>context</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcoap__str__const__t.html">coap_str_const_t</a> *&#160;</td>
          <td class="paramname"><em>uri_path</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns the resource identified by the unique string <code>uri_path</code>. </p>
<p>If no resource was found, this function returns <code>NULL</code>.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">context</td><td>The context to look for this resource. </td></tr>
    <tr><td class="paramname">uri_path</td><td>The unique string uri of the resource.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A pointer to the resource or <code>NULL</code> if not found. </dd></dl>

<p class="definition">Definition at line <a class="el" href="resource_8c_source.html#l00515">515</a> of file <a class="el" href="resource_8c_source.html">resource.c</a>.</p>

</div>
</div>
<a id="a6fe7101754779c34807bf00b87ee5f0b" name="a6fe7101754779c34807bf00b87ee5f0b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6fe7101754779c34807bf00b87ee5f0b">&#9670;&#160;</a></span>coap_handle_failed_notify()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void coap_handle_failed_notify </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__context__t.html">coap_context_t</a> *&#160;</td>
          <td class="paramname"><em>context</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcoap__session__t.html">coap_session_t</a> *&#160;</td>
          <td class="paramname"><em>session</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structcoap__binary__t.html">coap_binary_t</a> *&#160;</td>
          <td class="paramname"><em>token</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="resource_8c_source.html#l00930">930</a> of file <a class="el" href="resource_8c_source.html">resource.c</a>.</p>

</div>
</div>
<a id="ae1a91e254baca4f43b7896f54a8d9944" name="ae1a91e254baca4f43b7896f54a8d9944"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae1a91e254baca4f43b7896f54a8d9944">&#9670;&#160;</a></span>coap_notify_observers()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void coap_notify_observers </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__context__t.html">coap_context_t</a> *&#160;</td>
          <td class="paramname"><em>context</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcoap__resource__t.html">coap_resource_t</a> *&#160;</td>
          <td class="paramname"><em>r</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="resource_8c_source.html#l00745">745</a> of file <a class="el" href="resource_8c_source.html">resource.c</a>.</p>

</div>
</div>
<a id="a1ee72943df541ed5d4294c13e967ef09" name="a1ee72943df541ed5d4294c13e967ef09"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1ee72943df541ed5d4294c13e967ef09">&#9670;&#160;</a></span>coap_print_link()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="resource_8h.html#a91b02fe05f44f053f50c8d07b03f1f6e">coap_print_status_t</a> coap_print_link </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structcoap__resource__t.html">coap_resource_t</a> *&#160;</td>
          <td class="paramname"><em>resource</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned char *&#160;</td>
          <td class="paramname"><em>buf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t *&#160;</td>
          <td class="paramname"><em>len</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t *&#160;</td>
          <td class="paramname"><em>offset</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Writes a description of this resource in link-format to given text buffer. </p>
<p><code>len</code> must be initialized to the maximum length of <code>buf</code> and will be set to the number of characters actually written if successful. This function returns <code>1</code> on success or <code>0</code> on error.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">resource</td><td>The resource to describe. </td></tr>
    <tr><td class="paramname">buf</td><td>The output buffer to write the description to. </td></tr>
    <tr><td class="paramname">len</td><td>Must be initialized to the length of <code>buf</code> and will be set to the length of the printed link description. </td></tr>
    <tr><td class="paramname">offset</td><td>The offset within the resource description where to start writing into <code>buf</code>. This is useful for dealing with the Block2 option. <code>offset</code> is updated during output as it is consumed.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>If COAP_PRINT_STATUS_ERROR is set, an error occured. Otherwise, the lower 28 bits will indicate the number of characters that have actually been output into <code>buffer</code>. The flag COAP_PRINT_STATUS_TRUNC indicates that the output has been truncated. </dd></dl>

<p class="definition">Definition at line <a class="el" href="resource_8c_source.html#l00524">524</a> of file <a class="el" href="resource_8c_source.html">resource.c</a>.</p>

</div>
</div>
<a id="a82195178fe216a47a0cf8a88aa09c9cd" name="a82195178fe216a47a0cf8a88aa09c9cd"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a82195178fe216a47a0cf8a88aa09c9cd">&#9670;&#160;</a></span>coap_print_wellknown()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="resource_8h.html#a91b02fe05f44f053f50c8d07b03f1f6e">coap_print_status_t</a> coap_print_wellknown </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__context__t.html">coap_context_t</a> *&#160;</td>
          <td class="paramname"><em>context</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned char *&#160;</td>
          <td class="paramname"><em>buf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t *&#160;</td>
          <td class="paramname"><em>buflen</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>offset</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="option_8h.html#a963ad4994625360a5ac70d9df2ab5412">coap_opt_t</a> *&#160;</td>
          <td class="paramname"><em>query_filter</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Prints the names of all known resources to <code>buf</code>. </p>
<p>This function sets <code>buflen</code> to the number of bytes actually written and returns <code>1</code> on succes. On error, the value in <code>buflen</code> is undefined and the return value will be <code>0</code>.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">context</td><td>The context with the resource map. </td></tr>
    <tr><td class="paramname">buf</td><td>The buffer to write the result. </td></tr>
    <tr><td class="paramname">buflen</td><td>Must be initialized to the maximum length of <code>buf</code> and will be set to the length of the well-known response on return. </td></tr>
    <tr><td class="paramname">offset</td><td>The offset in bytes where the output shall start and is shifted accordingly with the characters that have been processed. This parameter is used to support the block option. </td></tr>
    <tr><td class="paramname">query_filter</td><td>A filter query according to <a href="http://tools.ietf.org/html/draft-ietf-core-link-format-11#section-4.1">Link Format</a></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>COAP_PRINT_STATUS_ERROR on error. Otherwise, the lower 28 bits are set to the number of bytes that have actually been written to <code>buf</code>. COAP_PRINT_STATUS_TRUNC is set when the output has been truncated. </dd></dl>

<p class="definition">Definition at line <a class="el" href="resource_8c_source.html#l00169">169</a> of file <a class="el" href="resource_8c_source.html">resource.c</a>.</p>

</div>
</div>
<a id="af3e125d7975a649b6ac818c8bfb87baa" name="af3e125d7975a649b6ac818c8bfb87baa"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af3e125d7975a649b6ac818c8bfb87baa">&#9670;&#160;</a></span>coap_register_handler()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void coap_register_handler </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__resource__t.html">coap_resource_t</a> *&#160;</td>
          <td class="paramname"><em>resource</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned char&#160;</td>
          <td class="paramname"><em>method</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="resource_8h.html#a0e546da5428d06e7bd64308f3e0434af">coap_method_handler_t</a>&#160;</td>
          <td class="paramname"><em>handler</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Registers the specified <code>handler</code> as message handler for the request type <code>method</code>. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">resource</td><td>The resource for which the handler shall be registered. </td></tr>
    <tr><td class="paramname">method</td><td>The CoAP request method to handle. </td></tr>
    <tr><td class="paramname">handler</td><td>The handler to register with <code>resource</code>. </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="resource_8c_source.html#l00577">577</a> of file <a class="el" href="resource_8c_source.html">resource.c</a>.</p>

</div>
</div>
<a id="a912a935612cb6910a4c466c49d58ee98" name="a912a935612cb6910a4c466c49d58ee98"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a912a935612cb6910a4c466c49d58ee98">&#9670;&#160;</a></span>coap_remove_failed_observers()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void coap_remove_failed_observers </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__context__t.html">coap_context_t</a> *&#160;</td>
          <td class="paramname"><em>context</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcoap__resource__t.html">coap_resource_t</a> *&#160;</td>
          <td class="paramname"><em>resource</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcoap__session__t.html">coap_session_t</a> *&#160;</td>
          <td class="paramname"><em>session</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structcoap__binary__t.html">coap_binary_t</a> *&#160;</td>
          <td class="paramname"><em>token</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Checks the failure counter for (peer, token) and removes peer from the list of observers for the given resource when COAP_OBS_MAX_FAIL is reached. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">context</td><td>The CoAP context to use </td></tr>
    <tr><td class="paramname">resource</td><td>The resource to check for (peer, token) </td></tr>
    <tr><td class="paramname">session</td><td>The observer's session </td></tr>
    <tr><td class="paramname">token</td><td>The token that has been used for subscription. </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="resource_8c_source.html#l00887">887</a> of file <a class="el" href="resource_8c_source.html">resource.c</a>.</p>

</div>
</div>
<a id="a9edd43fc111e854367ef646a21bd93b1" name="a9edd43fc111e854367ef646a21bd93b1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9edd43fc111e854367ef646a21bd93b1">&#9670;&#160;</a></span>coap_resource_init()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structcoap__resource__t.html">coap_resource_t</a> * coap_resource_init </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__str__const__t.html">coap_str_const_t</a> *&#160;</td>
          <td class="paramname"><em>uri_path</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>flags</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Creates a new resource object and initializes the link field to the string <code>uri_path</code>. </p>
<p>This function returns the new <a class="el" href="structcoap__resource__t.html">coap_resource_t</a> object.</p>
<p>If the string is going to be freed off by <a class="el" href="resource_8h.html#ad3521b724ad4961e6bb11801fd82a3e3" title="Deletes a resource identified by resource.">coap_delete_resource()</a> when COAP_RESOURCE_FLAGS_RELEASE_URI is set in <code>flags</code>, then either the 's' variable of <a class="el" href="structcoap__str__const__t.html" title="Coap string data definition with const data.">coap_str_const_t</a> has to point to constant text, or point to data within the allocated <a class="el" href="structcoap__str__const__t.html" title="Coap string data definition with const data.">coap_str_const_t</a> parameter.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">uri_path</td><td>The string URI path of the new resource. </td></tr>
    <tr><td class="paramname">flags</td><td>Flags for memory management (in particular release of memory). Possible values:<br  />
 COAP_RESOURCE_FLAGS_RELEASE_URI If this flag is set, the URI passed to <a class="el" href="resource_8h.html#a9edd43fc111e854367ef646a21bd93b1" title="Creates a new resource object and initializes the link field to the string uri_path.">coap_resource_init()</a> is free'd by <a class="el" href="resource_8h.html#ad3521b724ad4961e6bb11801fd82a3e3" title="Deletes a resource identified by resource.">coap_delete_resource()</a><br  />
 COAP_RESOURCE_FLAGS_NOTIFY_CON If this flag is set, coap-observe notifications will be sent confirmable by default.<br  />
 COAP_RESOURCE_FLAGS_NOTIFY_NON (default) If this flag is set, coap-observe notifications will be sent non-confirmable by default.<br  />
 If flags is set to 0 then the COAP_RESOURCE_FLAGS_NOTIFY_NON is considered.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A pointer to the new object or <code>NULL</code> on error. </dd></dl>

<p class="definition">Definition at line <a class="el" href="resource_8c_source.html#l00300">300</a> of file <a class="el" href="resource_8c_source.html">resource.c</a>.</p>

</div>
</div>
<a id="a44d6a5ed6425069699a01f7e8ed72579" name="a44d6a5ed6425069699a01f7e8ed72579"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a44d6a5ed6425069699a01f7e8ed72579">&#9670;&#160;</a></span>coap_resource_notify_observers()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int coap_resource_notify_observers </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__resource__t.html">coap_resource_t</a> *&#160;</td>
          <td class="paramname"><em>resource</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structcoap__string__t.html">coap_string_t</a> *&#160;</td>
          <td class="paramname"><em>query</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Initiate the sending of an Observe packet for all observers of <code>resource</code>, optionally matching <code>query</code> if not NULL. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">resource</td><td>The CoAP resource to use. </td></tr>
    <tr><td class="paramname">query</td><td>The Query to match against or NULL</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><code>1</code> if the Observe has been triggered, <code>0</code> otherwise. </dd></dl>

<p class="definition">Definition at line <a class="el" href="resource_8c_source.html#l00837">837</a> of file <a class="el" href="resource_8c_source.html">resource.c</a>.</p>

</div>
</div>
<a id="a498adb2e66123e55cf6b0bb0ee061760" name="a498adb2e66123e55cf6b0bb0ee061760"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a498adb2e66123e55cf6b0bb0ee061760">&#9670;&#160;</a></span>coap_resource_set_dirty()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int coap_resource_set_dirty </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__resource__t.html">coap_resource_t</a> *&#160;</td>
          <td class="paramname"><em>r</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structcoap__string__t.html">coap_string_t</a> *&#160;</td>
          <td class="paramname"><em>query</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<dl class="deprecated"><dt><b><a class="el" href="deprecated.html#_deprecated000008">Deprecated:</a></b></dt><dd>use <a class="el" href="resource_8h.html#a0a053626d2f222a32cc96c4a3dd9902f" title="Initiate the sending of an Observe packet for all observers of resource, optionally matching query if...">coap_resource_notify_observers()</a> instead. </dd></dl>

<p class="definition">Definition at line <a class="el" href="resource_8c_source.html#l00832">832</a> of file <a class="el" href="resource_8c_source.html">resource.c</a>.</p>

</div>
</div>
<a id="af892e2c08f144561327b11b65396d5cc" name="af892e2c08f144561327b11b65396d5cc"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af892e2c08f144561327b11b65396d5cc">&#9670;&#160;</a></span>coap_resource_unknown_init()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structcoap__resource__t.html">coap_resource_t</a> * coap_resource_unknown_init </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="resource_8h.html#a0e546da5428d06e7bd64308f3e0434af">coap_method_handler_t</a>&#160;</td>
          <td class="paramname"><em>put_handler</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Creates a new resource object for the unknown resource handler with support for PUT. </p>
<p>In the same way that additional handlers can be added to the resource created by <a class="el" href="resource_8h.html#a9edd43fc111e854367ef646a21bd93b1" title="Creates a new resource object and initializes the link field to the string uri_path.">coap_resource_init()</a> by using <a class="el" href="resource_8h.html#af3e125d7975a649b6ac818c8bfb87baa" title="Registers the specified handler as message handler for the request type method.">coap_register_handler()</a>, POST, GET, DELETE etc. handlers can be added to this resource. It is the responsibility of the application to manage the unknown resources by either creating new resources with <a class="el" href="resource_8h.html#a9edd43fc111e854367ef646a21bd93b1" title="Creates a new resource object and initializes the link field to the string uri_path.">coap_resource_init()</a> (which should have a DELETE handler specified for the resource removal) or by maintaining an active resource list.</p>
<p>Note: There can only be one unknown resource handler per context - attaching a new one overrides the previous definition.</p>
<p>Note: It is not possible to observe the unknown resource with a GET request</p><ul>
<li>a separate resource needs to be reated by the PUT (or POST) handler, and make that resource observable.</li>
</ul>
<p>This function returns the new <a class="el" href="structcoap__resource__t.html">coap_resource_t</a> object.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">put_handler</td><td>The PUT handler to register with <code>resource</code> for unknown Uri-Path.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A pointer to the new object or <code>NULL</code> on error. </dd></dl>

<p class="definition">Definition at line <a class="el" href="resource_8c_source.html#l00334">334</a> of file <a class="el" href="resource_8c_source.html">resource.c</a>.</p>

</div>
</div>
<a id="ad5bbd78aad763b34f4c0905fcd7b7454" name="ad5bbd78aad763b34f4c0905fcd7b7454"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad5bbd78aad763b34f4c0905fcd7b7454">&#9670;&#160;</a></span>coap_touch_observer()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void coap_touch_observer </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__context__t.html">coap_context_t</a> *&#160;</td>
          <td class="paramname"><em>context</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcoap__session__t.html">coap_session_t</a> *&#160;</td>
          <td class="paramname"><em>session</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structcoap__binary__t.html">coap_binary_t</a> *&#160;</td>
          <td class="paramname"><em>token</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Marks an observer as alive. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">context</td><td>The CoAP context to use. </td></tr>
    <tr><td class="paramname">session</td><td>The observer's session </td></tr>
    <tr><td class="paramname">token</td><td>The corresponding token that has been used for the subscription. </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="resource_8c_source.html#l00690">690</a> of file <a class="el" href="resource_8c_source.html">resource.c</a>.</p>

</div>
</div>
<a id="a5d3c8be95fcb4b66ba2f399896366a0e" name="a5d3c8be95fcb4b66ba2f399896366a0e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5d3c8be95fcb4b66ba2f399896366a0e">&#9670;&#160;</a></span>match()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static int match </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structcoap__str__const__t.html">coap_str_const_t</a> *&#160;</td>
          <td class="paramname"><em>text</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structcoap__str__const__t.html">coap_str_const_t</a> *&#160;</td>
          <td class="paramname"><em>pattern</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>match_prefix</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>match_substring</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="resource_8c_source.html#l00105">105</a> of file <a class="el" href="resource_8c_source.html">resource.c</a>.</p>

</div>
</div>
<h2 class="groupheader">Variable Documentation</h2>
<a id="a0ace1279431c2224cf7c4a95fed6d0e0" name="a0ace1279431c2224cf7c4a95fed6d0e0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0ace1279431c2224cf7c4a95fed6d0e0">&#9670;&#160;</a></span>coap_unknown_resource_uri</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="uthash_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> coap_unknown_resource_uri[]</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<b>Initial value:</b><div class="fragment"><div class="line">=</div>
<div class="line">                       <span class="stringliteral">&quot;- Unknown -&quot;</span></div>
</div><!-- fragment -->
<p class="definition">Definition at line <a class="el" href="resource_8c_source.html#l00330">330</a> of file <a class="el" href="resource_8c_source.html">resource.c</a>.</p>

</div>
</div>
<a id="abbe07ff1da181a7b0429384afaf0c381" name="abbe07ff1da181a7b0429384afaf0c381"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abbe07ff1da181a7b0429384afaf0c381">&#9670;&#160;</a></span>null_path</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structcoap__str__const__t.html">coap_str_const_t</a>* null_path = <a class="el" href="group__string.html#ga3a9d1f377dc7a25aa8b6136a169f76c1">coap_make_str_const</a>(&quot;&quot;)</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="resource_8c_source.html#l00297">297</a> of file <a class="el" href="resource_8c_source.html">resource.c</a>.</p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="resource_8c.html">resource.c</a></li>
    <li class="footer">Generated on Fri Dec 27 2024 09:57:44 for libcoap by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.8 </li>
  </ul>
</div>
</body>
</html>
